package com.dsy.xiangcun_manage.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsy.tools.common.utils.QueryObj;
import com.dsy.tools.entity.TbPhoto;
import com.dsy.xiangcun_manage.mapper.TbPhotoMapper;
import com.dsy.xiangcun_manage.service.ITbPhotoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author dsy
 * @since 2023-03-07
 */
@Service
public class TbPhotoServiceImpl extends ServiceImpl<TbPhotoMapper, TbPhoto> implements ITbPhotoService {
    @Autowired
    TbPhotoMapper mapMapper;
    @Override
    public IPage<TbPhoto> getAllPhoto(long page, long limit, QueryWrapper<QueryObj> wrapper) {
        return mapMapper.getAllMap(new Page<>(page,limit),wrapper);
    }

    @Override
    public TbPhoto getPhotoById(Integer photoId) {
        return mapMapper.getMapById(photoId);
    }
}
